package com.example.pet.service;

import com.example.pet.hystrix.FriendsRelServiceHystrix;
import com.hj.pet.model.FriendsRel;
import com.hj.pet.model.ReturnT;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

@Component
@FeignClient(name = "pet-service",fallback = FriendsRelServiceHystrix.class)
public interface FriendsRelService {
    @RequestMapping(value = "/internal/FR/save",method = RequestMethod.POST)
    @ResponseBody
    public ReturnT<?> save(@RequestBody FriendsRel friendsRel);

    @RequestMapping(value = "/internal/FR/updateByUserId",method = RequestMethod.POST)
    @ResponseBody
    public ReturnT<?> updateByUserId(@RequestBody FriendsRel friendsRel);

    @RequestMapping(value = "/internal/FR/findRelsByUser1",method = RequestMethod.GET)
    @ResponseBody
    public ReturnT<?> findRelsByUser1(@RequestParam String user_1);

    @RequestMapping(value = "/internal/FR/findRelsByUser2",method = RequestMethod.GET)
    @ResponseBody
    public ReturnT<?> findRelsByUser2(@RequestParam String user_2);

    @RequestMapping(value = "/internal/FR/delRelByUser",method = RequestMethod.DELETE)
    @ResponseBody
    public ReturnT<?> delRelByUser(@RequestParam String user_1,@RequestParam String user_2);

    @RequestMapping(value = "/internal/FR/findRels",method = RequestMethod.GET)
    @ResponseBody
    public ReturnT<?> findRels(@RequestBody FriendsRel friendsRel);

    @RequestMapping(value = "/internal/FR/addFriendRequest",method = RequestMethod.POST)
    @ResponseBody
    public ReturnT<?> addFriendRequest(@RequestBody FriendsRel friendsRel);

    @RequestMapping(value = "/internal/FR/getDealingRels",method = RequestMethod.GET)
    @ResponseBody
    public ReturnT<?> getDealingRels(@RequestParam String user1);

    @RequestMapping(value = "/internal/FR/getDealingRels2",method = RequestMethod.GET)
    @ResponseBody
    public ReturnT<?> getDealingRels(@RequestParam String user1,@RequestParam Integer status);

    @RequestMapping(value = "/internal/FR/dealFriendRel",method = RequestMethod.POST)
    @ResponseBody
    public ReturnT<?> dealFriendRel(@RequestBody FriendsRel friendsRel);

    @RequestMapping(value = "/internal/FR/getAllFriends",method = RequestMethod.GET)
    @ResponseBody
    public ReturnT<?> getAllFriends(@RequestParam String user1);


}
